home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 1.iso
/
ARGONET
/
PD
/
PROGRAMMING
/
DESKLIBC
/
SOURCES.ZIP
/
DeskLib
/
!DLSources
/
Libraries
/
Icon
/
c
/
DisposeInd
< prev
next >
Wrap
Text File
|
1995-07-08
|
2KB
|
47 lines
/*
#### # # # #
# # # # # The FreeWare C library for
# # ## ### # # # # ### RISC OS machines
# # # # # # # # # # # ___________________________________
# # #### ### ## # # # #
# # # # # # # # # # Please refer to the accompanying
#### ### #### # # ##### # ### documentation for conditions of use
________________________________________________________________________
File: Icons.DisposeInd.c
Author: Copyright © 1993 (Tim Browse)
Version: 1.00 (27 Mar 1993)
Purpose: Dispose indirected data space used by an icon. Note that this
data must have been allocated with malloc() originally.
*/
#include <stdlib.h>
#include "DeskLib:Wimp.h"
#include "DeskLib:Icon.h"
extern void Icon_DisposeIndData(icon_data *data, icon_flags flags)
{
/* make sure this icon is indirected - exit quietly if not */
if ((data == NULL) || (!flags.data.indirected))
return;
if (!flags.data.text && flags.data.sprite) /* Sprite only icon */
{
if (data->indirectsprite.nameisname)
free((void *) data->indirectsprite.name);
return;
}
if (flags.data.text || flags.data.sprite) /* Text/Text&Sprite icon */
{
free(data->indirecttext.buffer);
/* Free validation string, if there is one */
if ((data->indirecttext.validstring != NULL) &&
(data->indirecttext.validstring != (char *) 0xffffffff))
free(data->indirecttext.validstring);
}
}